package mvc.unti;

import java.lang.reflect.Field;

import javax.servlet.http.HttpServletRequest;

import mvc.form.ActionForm;

public class FullBean {
	
	public FullBean(){
		
	}
	
	public static ActionForm full(HttpServletRequest request){
		ActionForm obj = null;
		try {
			Class clazz = Class.forName(request.getParameter("sign"));
			obj =(ActionForm) clazz.newInstance();
			Field[] f_arr = clazz.getDeclaredFields();
			for(Field f :f_arr){
				f.setAccessible(true);
				f.set(obj, request.getParameter(f.getName()));
				f.setAccessible(false);
				
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		return obj;
	}

}
